<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


/**
 * App\Models\Wallet
 *
 * @property int $id
 * @property int $uid 会员ID
 * @property float $balance 账户余额
 * @property float $total_income 累计收入
 * @property float $total_cost 累计支出
 * @property float $integral
 * @property float $commssion
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereBalance($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereTotalCost($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereTotalIncome($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereUid($value)
 * @mixin \Eloquent
 * @property float|null $commission 佣金
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereCommission($value)
 * @property float|null $points 消费积分
 * @property float|null $freeze_points 非激活积分
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereFreezePoints($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet wherePoints($value)
 * @property float $bonus_points 非激活积分
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereBonusPoints($value)
 * @property float $node_achievement 节点业绩
 * @property float $node_commission 节点佣金
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereNodeAchievement($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereNodeCommission($value)
 */
class Wallet extends Model
{
    protected $table = 'wallet';
    protected $primaryKey = 'uid';
    protected $guarded = ['uid'];

    public $timestamps = false;

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'uid');
    }
}
